package lego.jbv;

import lejos.geom.Point;

public class DirectionPlanning {

	static public double GetAngle(Point from, Point to)
	{
		double X = to.getX()-from.getX();
		double Y = to.getY()-from.getY();
		
		return Math.toDegrees(Math.atan2(Y,X));
	}
	
	public static double GetDistance(Point a1, Point a2)
	{
		double xSqr = 
				(a1.getX() - a2.getX()) *  
				(a1.getX() - a2.getX());
		
		double ySqr = 
				(a1.getY() - a2.getY()) * 
				(a1.getY() - a2.getY());
		
		return Math.sqrt(xSqr + ySqr);
	}
}
